﻿Imports System.Data.OleDb

Partial Public Class showTagssub
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim TagName As String = Request.QueryString("TagName").ToString()

        'Dim dbconn = New OleDbConnection(ConfigurationManager.ConnectionStrings _
        '                  ("ConnectionString").ToString())
        'dbconn.Open()
        'Dim usersql As String = "SELECT [TagName], [MaterialName] FROM [tagquerysub] WHERE [TagName] =" & TagName
        'Dim usersqlcmd As New OleDbCommand(usersql, dbconn)
        'Dim usersqlReading = usersqlcmd.ExecuteReader()
        'usersqlReading.Read()
    End Sub

    'Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.SelectedIndexChanged


    '    Dim index As Integer = GridView1.SelectedIndex

    '    ' Display the primary key value of the selected row.
    '    Dim row As GridViewRow = GridView1.SelectedRow

    '    'Response.Redirect("details.aspx?materialID=" & GridView1.DataKeys(index).Value.ToString())

    'End Sub

    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand

        If e.CommandName = "View" Then

            Dim index As Integer = Convert.ToInt32(e.CommandArgument)

            Response.Redirect("details.aspx?materialID=" & GridView1.DataKeys(index).Value.ToString())
        End If

    End Sub

End Class